package pattern.singleton;

/**
 * 懒汉模式（延迟初始化）
 * @author 86137
 */
public class Singleton2 {
    /**
     * 私有构造对象
     */
    private Singleton2(){

    }

    public static class InstanceHolder {
        public static Singleton2 instance = new Singleton2();
    }

    public static Singleton2 getInstance(){
        return InstanceHolder.instance;
    }
}
